<template>
	<div>
		<el-card shadow="never">
			<!-- <h1>{{this.$router.currentRoute.name}}</h1> -->
			<el-table v-loading="loading" :data="tableData" style="width: 100%;margin-top: 20px">
				<el-table-column type="index" width="50"></el-table-column>
				<el-table-column label="消息ID" align="center"  prop="msgID"></el-table-column>
				<el-table-column label="发送状态" align="center"  prop="status">
					
				</el-table-column>
				<el-table-column label="接收模板消息用户的openID" width="300" align="center"  prop="fromUserName"></el-table-column>
				<el-table-column label="公众微信号" align="center" width="150"  prop=" toUserName"></el-table-column>
				<el-table-column label="创建时间" align="center"  width="200" prop="createTime"></el-table-column>
				<el-table-column label="消息类型" align="center"  prop="msgType"></el-table-column>
				<el-table-column label="模板消息结束" align="center"  width="200"  prop="event"></el-table-column>
				<el-table-column label="系统发送时间" align="center"  width="200" prop="pushTime"></el-table-column>
				<el-table-column label="通知类型" align="center"  prop="pushType">
					<template scope="scope">
						<span v-if="scope.row.pushType == 1">预约通知</span>
						<span v-if="scope.row.pushType == 2">订单通知</span>
						<span v-if="scope.row.pushType == 3">工单通知</span>
					</template>
				</el-table-column>
				<el-table-column label="回调url" align="center"  prop="url"></el-table-column>
				<el-table-column label="字段1" align="center"  prop="keyword1"></el-table-column>
				<el-table-column label="字段2" align="center"  prop="keyword2"></el-table-column>
				<el-table-column label="字段3" align="center"  prop="keyword3"></el-table-column>
				<el-table-column label="字段4" align="center"  prop="keyword4"></el-table-column>
				<el-table-column label="字段5" align="center" prop="keyword5"></el-table-column>
				<el-table-column label="模板ID" align="center"  prop=" templateId"></el-table-column>
			</el-table>
			<div style="margin-top: 20px;text-align: right">
				<el-pagination
					background
					@current-change="columnFind"
					:current-page="page.page"
					:page-size="page.pagesize"
					layout="prev, pager, next, jumper, total"
					:total="page.count"
				></el-pagination>
			</div>
		</el-card>
	</div>
</template>

<script>
import { wechatPushLogList } from '../../../../server/index.js';
import Cookie from 'js-cookie';
export default {
	data() {
		return {
			tableData: [],
			page: {
				count: 0,
				pagesize: 10,
				page: 1
			},
			loading: true
		};
	},
	mounted() {
		var page = 1;
		this.columnFind(page);
		Cookie.remove('tabList');
	},
	methods: {
		columnFind(page) {
			const _this = this;
			_this.page.page = page;
			let obj = {
				keyword: '',
				page: _this.page.page,
				rows: _this.page.pagesize,
			}; 
			// _this.tableData = []

			this.http.request({
				url: wechatPushLogList,
				data: obj,
				success: function(res) {
					_this.loading = false;
					_this.tableData = res.list;
					_this.page.count = res.total;
				},
				error:function(err){
					_this.$message({
						offset: '200',
						message: err.msg
					})
				}
			});
		}
	}
};
</script>

<style></style>
